# -*- coding: utf8-*-
_author_ = 'yykrlc'


from app import werobot

from app.werobot import WeRoBot

myrobot = WeRoBot(token='token')


@myrobot.handler
def hello(message):
    return 'Hello World!'
# 然后, 在 Flask 项目中为 Flask 实例集成 WeRoBot

from flask import Flask
#from robot import myrobot
from werobot.contrib.flask import make_view

app = Flask(__name__)
app.add_url_rule(rule='/robot/', # WeRoBot 挂载地址
                 endpoint='werobot', # Flask 的 endpoint
                 view_func=make_view(myrobot),
                 methods=['GET', 'POST'])